<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
-->
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title><%= @title.nil? ? "my => :life" :"my => :life | #{@title}" %></title>
    <%= stylesheet_link_tag "text_main" %>
  </head>
  
  <body>
    <div id="container">
      <!-- header -->

      <div id="header">
        <h2>my => :life</h2>       
      </div>
      <!--end header -->
      <!-- main -->
      <div id="sidebar">
        <div class="sidebar_top"></div>
        <div class="sidebar_main">
          <h3>Tags</h3>
          <ul>
						 <% @all_categories.each do |category| %>
               <li><%= link_to "#{category.name}（#{category.articles.count}）",category_path(category) %></li>
						<% end %>
          </ul>
        </div>
        <div class="sidebar_bottom"></div>
        
        <div class="sidebar_top"></div>
        <div class="sidebar_main">
          <h3>Recent articles</h3>
          <ul>
							<% @lately_articles.each do |article| %>
                <li><%= link_to(article.title,"/articles/#{article.permalink}") %></li>
							<% end %>
          </ul>
        </div>
        <div class="sidebar_bottom"></div>
        
      </div>
      
      <div id="text">
        <div id="text_top"></div>
        
        <div id="text_main">
          <%= yield %>
        </div>
        
        <div id="text_bottom"></div>
      </div>
      <!-- end main -->
      <!-- footer -->
      <div id="footer">
      </div>
      <!-- end footer -->
    </div>
  </body>
</html>
